using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;

namespace Scheduler
{
    /*
     * The object of this class holds the price of a certain therapy 
     * for a certain duration.
     * The information held by this object are as follows:
     * duration: which is the duration of the therapy
     * price: which holds the price for this duration.
     */ 
    public class TherapyPrice
    {
        private int duration;
        private int price;

       public TherapyPrice()
       {
            duration = 0;
            price = 0;
       }

       public TherapyPrice(int givenDur, int givenPrice)
       {
            duration = givenDur;
            price = givenPrice;
       }

  

        public int Price
        {
            get { return price; }
            set { price = value; }
        }

        public int Duration
        {
            get { return duration; }
            set { duration = value; }
        }

        public void writeToDatabase(Database db, String rmtID, String therID)
        {
            db.writeTherapyPrice(this, rmtID, therID);
        }

        public void removeFromDatabase(Database db, String rmtID, String therID)
        {
            db.removeTherapyPrice(this, rmtID, therID);
        }

        
        public override String ToString()
        {
            return duration + " minutes for: $" + price + "\r\r\n";
        }
        public override bool Equals(object obj)
        {
            if (obj is TherapyPrice)
                return  (duration == ((TherapyPrice) obj).duration);
            else 
                return false;
        }
        

    }
}